<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title>Service UI Fragment</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main class="container mt-3 mb-3">
    <div th:fragment="serviceUI"
         th:if="${registeredService != null and #cas.isTrue(#cas.theme('cas.service-ui.show'))}"
         th:with="showServiceUIDetails=${#cas.isTrue(#cas.theme('cas.service-ui.show-details'))}"
         id="serviceui" class="banner banner-info mb-4 text-justify">

        <div th:if="${serviceUIMetadata}" class="d-flex align-items-center pr-2">
            <img id="serviceUIMetadataLogo" th:if="${serviceUIMetadata.logoUrl}" th:title="${serviceUIMetadata.displayName}"
                 th:alt="${serviceUIMetadata.displayName}" th:src="${serviceUIMetadata.logoUrl}"
                 th:width="${serviceUIMetadata.logoWidth}" th:height="${serviceUIMetadata.logoHeight}"/>

            <div class="ml-2">
                <h2 id="serviceUIMetadataDisplayName" th:utext="${serviceUIMetadata.displayName}">serviceUIMetadata.displayName</h2>
                <p th:if="${showServiceUIDetails}" id="serviceUIMetadataDescription"
                   th:utext="${serviceUIMetadata.description}">serviceUIMetadata.description</p>

                <div id="wildcardService" th:if="${#cas.isTrue(wildcardedRegisteredService) and showServiceUIDetails}">
                    <p><i class="mdi mdi-information-slab-box" aria-hidden="true"></i><span th:utext="#{screen.service.wildcard.message}" /></p>
                </div>

                <p id="serviceUIMetadataInformationUrl"
                   th:if="${serviceUIMetadata.informationURL != null && showServiceUIDetails}"
                   th:utext="#{screen.mdui.infolink.text(${serviceUIMetadata.informationURL})}">
                    screen.mdui.infolink.text</p>
                <p id="serviceUIMetadataPrivacyUrl"
                   th:if="${serviceUIMetadata.privacyStatementURL != null && showServiceUIDetails}"
                   th:utext="#{screen.mdui.privacylink.text(${serviceUIMetadata.privacyStatementURL})}">
                    serviceUIMetadata.privacyStatementURL</p>
            </div>
        </div>

        <div th:unless="${serviceUIMetadata}" class="d-flex align-items-center pr-2">
            <img th:if="${registeredService.logo}" th:src="${registeredService.logo}" th:alt="${registeredService.name}"/>
            <div id="servicedesc" class="ml-2">
                <strong><i class="mdi mdi-web" aria-hidden="true"></i>[[${registeredService.name}]]</strong>
                <p th:if="${showServiceUIDetails}" th:utext="${registeredService.description}">Registered Service Description</p>
                <div id="wildcardService" th:if="${showServiceUIDetails and #cas.isTrue(wildcardedRegisteredService)}">
                    <p><i class="mdi mdi-information-slab-box" aria-hidden="true"></i><span th:utext="#{screen.service.wildcard.message}" /></p>
                </div>
            </div>
        </div>

    </div>
</main>
</body>

</html>
